<%@ Page Title="Reports" Language="C#" MasterPageFile="~/masterpage.master" AutoEventWireup="true" CodeFile="Report.aspx.cs" Inherits="Report" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

	<script language='javascript'>
		var controldivname = 'ctl00_ContentPlaceHolder1_rgReport';

		function selectdate(date) {
			_control.value = date;
		}

		var _control;
		function OpenCalendar(control) {
			_control = control.parentNode.childNodes[1];
			var newwindow;
			var int_windowwidth = 340;
			var int_windowheight = 300;
			var int_windowLeft = (screen.width - int_windowwidth) / 2;
			var int_windowTop = (screen.height - int_windowheight) / 2;

			var setstring = 'height=' + int_windowheight + ',width=' + int_windowwidth + ', status=no,toolbar=no,menubar=no' + ',top=' + int_windowTop + ',left=' + int_windowLeft;
			newwindow = window.open('calendar.aspx', '_blank', setstring);

			if (window.focus) { newwindow.focus() }

		}

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

	<table cellspacing="0" cellpadding="0" width="90%">
	<tr align=left style="font-family: Arial, Helvetica, sans-serif;font-style: normal;font-size:12px;">
	<td style="width:180px;">	<asp:DropDownList ID="ddlReportType" runat="server" 
			AutoPostBack="True" 
			onselectedindexchanged="ddlReportType_SelectedIndexChanged" >
		<asp:ListItem Value="1">Demographics Report</asp:ListItem>
		<asp:ListItem Value="2">All Students Attendance Report</asp:ListItem>
		<asp:ListItem Value="3">Teachers Activity Report</asp:ListItem>
		<asp:ListItem Value="4">Attendance by Course</asp:ListItem>
		<asp:ListItem Value="5">Detailed Attendance Report</asp:ListItem>
	</asp:DropDownList></td>
<td runat="server" visible=false id="DetailedAttendanceReport">
<table cellpadding=0 cellspacing=0 width=510>
<tr style="font-size:11px;vertical-align:middle;">
<td height="20px" >&nbsp;From: </td><td>
<asp:TextBox ID="tbDate"  style="font-size:11px;width:65px;" runat="server"></asp:TextBox>
							  <asp:ImageButton style="position: relative; top: 2px" ID="ImageButton1" runat="server" ImageUrl="~/images/calendar.jpg" OnClientClick="OpenCalendar(this); return false;"/>
										<br />
							  <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="tbDate"
								  ErrorMessage="* Wrong Date Format (ex: 09/01/2008)" Display="Dynamic" ValidationExpression="[0-9]{2}/[[0-9]{2}/[0-9]{4}" SetFocusOnError="True"></asp:RegularExpressionValidator>
							  <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbDate"
								  ErrorMessage="* Date is Required Field" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
<td>&nbsp;To: </td><td>
<asp:TextBox ID="tbTo"  style="font-size:11px;width:65px;" runat="server"></asp:TextBox>
							  <asp:ImageButton style="position: relative; top: 2px"  ID="ImageButton2" runat="server" ImageUrl="~/images/calendar.jpg" OnClientClick="OpenCalendar(this); return false;"/>
										<br />
							  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="tbTo"
								  ErrorMessage="* Wrong Date Format (ex: 09/01/2008)" Display="Dynamic" ValidationExpression="[0-9]{2}/[[0-9]{2}/[0-9]{4}" SetFocusOnError="True"></asp:RegularExpressionValidator>
							  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbTo"
								  ErrorMessage="* Date is Required Field" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
<td valign=middle  align="right" >&nbsp;Exclude:</td><td>
<asp:CheckBox ID="cbE" Text="E" runat="server" />
<asp:CheckBox ID="cbM" Text="M" runat="server" />
<asp:CheckBox ID="cbF" Text="F" runat="server" />
<asp:CheckBox ID="cbP" Text="P" runat="server" />
<asp:CheckBox ID="cbQ" Text="Q" runat="server" />
<asp:CheckBox ID="cbO" Text="O" runat="server" />
<asp:CheckBox ID="cbW" Text="W" runat="server" /></td>
</tr>
</table>

</td>
	<td style="width:290px;" runat="server" id="DemographicsReportFilter" >Section:&nbsp;<asp:DropDownList ID="ddlSections" runat="server" DataTextField="SECTION_TITLE" 
		DataValueField="SECTION_ID">
	</asp:DropDownList></td>
	<td>
	<table cellpadding=0 cellspacing=0 width=150>
	<tr>
	<td><asp:ImageButton ID="bGo"  runat="server" ImageUrl="images/go_button.png" Text="Go" onclick="bGo_Click" /></td>
	<td>&nbsp;
	Page Size:
	<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
			onselectedindexchanged="DropDownList1_SelectedIndexChanged">
			<asp:ListItem Selected="True" Value="10"></asp:ListItem>
			<asp:ListItem>25</asp:ListItem>
			<asp:ListItem>50</asp:ListItem>
			<asp:ListItem Value="-1">All</asp:ListItem>
		</asp:DropDownList></td>
	</tr>
	</table>
	
	
		
	</td>
	<td align="right">
		<asp:ImageButton ImageUrl="Images/excel_icon2.png" ID="lbExport" runat="server" 
		onclick="lbExport_Click" ToolTip="Export to Excel" Visible="False" ></asp:ImageButton></td>
	</tr>
	<tr>
<td colspan=2>&nbsp; </td>
</tr>
	</table>
	


	<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
	</telerik:RadScriptManager>
<telerik:RadGrid ID="rgReport" runat="server" AllowPaging="True" 
		AllowSorting="True" Height="400px" Width="90%" 
		onsortcommand="rgReport_SortCommand" 
		onpageindexchanged="rgReport_PageIndexChanged" Visible="False" onitemdatabound="rgReport_ItemDataBound"
		>
<ItemStyle HorizontalAlign=Left />		
<AlternatingItemStyle HorizontalAlign=Left />		
		<HeaderStyle  Font-Bold="True" Font-Underline="False" Font-Size=9 HorizontalAlign=Center  />
<HeaderContextMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>

<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>

<FilterMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>

            <ItemStyle BackColor="Silver" />
	<AlternatingItemStyle BackColor="LightGray" />

            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling>
            </ClientSettings>

</telerik:RadGrid>

</asp:Content>

